package cn.niit.pm.entity;

import com.sun.istack.internal.NotNull;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import lombok.NoArgsConstructor;
import org.apache.ibatis.type.Alias;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * fahui
 * 员工实体类
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Alias("Employee")
@ApiModel("员工实体类")
public class Employee extends BaseEntity{
    private Long employeeId;

    @NotBlank(message = "请求输入用户姓名！")
    @Length(min = 1, max = 24, message = "用户姓名长度必须在1 ~ 24 个字符范围内！")
    private String employeeName;  //员工姓名

    @Length(min = 3, max = 16, message = "用户密码长度必须在6 ~ 16 个字符范围内！")
    private String password; //员工密码
    private Integer employeeRole;  //员工角色

    @NotNull
    private Integer gander;    //员工性别

    @NotNull
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date birth;  //员工生日
    private String email;  //员工邮箱
    private String address;  //员工地址

    @Length(min = 11, max = 11, message = "手机号长度不正确！")
    private String  phone;  //员工手机
    private Long departmentId; //员工所属部门id
    private  Long postId;  //员工所属岗位id
    private Long totalSalary; //员工最终薪资
    private Integer jobStatus; //在职状态
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private  Date entryDate; //入职时间
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private  Date resignationDate; //离职时间

    //扩展字段
    private String departmentName;
    private String postName;
}
